package ovm.gui.forms.exam;

import ovm.entity.ExamBlankEntity;
import ovm.gui.forms.AbstractEntityForm;
import ovm.management.AbstractManager;
import ovm.management.exam.ExamManager;

import static ovm.application.MainApplication.navigator;

/**
 * Created by IntelliJ IDEA.
 * User: Jokser
 * Date: 14.06.12
 * Time: 23:45
 * To change this template use File | Settings | File Templates.
 */

public class ExamBlankEntityForm extends AbstractEntityForm {

    public ExamBlankEntityForm(Object entity, Boolean editable) {
        super(entity, editable);
        setCaption("Экзамен для студента");
    }

    @Override
    public void commit() {
        if (ExamManager.persistExamBlank((ExamBlankEntity) entity) == 0) {
            navigator.showNotification("Запись успешно добавлена или изменена");
            setVisible(false);
        } else {
            navigator.showNotification("Произошла ошибка");
        }
    }


}
